const nodeMediaServer = require('node-media-server')
const nodeMediaConfig = {
	rtmp: {
		port: 1935,
		chunk_size: 60000,
		gop_cache: true,
		ping: 30,
		ping_timeout: 60,
		// http_api: 1
	},
	http: {
		port: 82,
		allow_origin: '*',
		api: true
	},
	// auth: {
	// 	play: true,
	// 	publish: true,
	// 	secret: 'astonishing'
	// }
}

let nms = new nodeMediaServer(nodeMediaConfig)
nms.run()
//postPublish 开始推流 donePublish 结束推流
//postPlay 开始播放 donePlay 结束播放
//postRecord 开始录像  doneRecord 结束录像
nms.on('postPublish', data => {
	console.log(data, '开始')
})
nms.on('donePublish', data => {
	console.log(data, '结束')
})